#include "comm.hpp"

int main()
{
    int wfd = open(NAMED_PIPE,O_WRONLY);
    if(wfd < 0)exit(1);


    while(true)
    {
        char buffer[1024];
        std::cout << "Please say#";
        fgets(buffer,sizeof(buffer),stdin);
        if(strlen(buffer) > 0) buffer[strlen(buffer) - 1] = 0;
        int n = write(wfd,buffer,strlen(buffer));
        assert(n == strlen(buffer));
        (void)n;


    }

    close(wfd);

    return 0;
}